<div class="main">
    <el-form ref="editForm" :model="form" label-width="130px" label-position="left" style="width:100%">
        <div class="hh">
            <el-row>
                <el-col span="12">菜单配置</el-col>
                <el-col span="12" align="right">
                    <el-button type="danger" @click="delItem()">删除</el-button>
                </el-col>
            </el-row>
        </div>
        <div class="mm">
            <el-form-item label="菜单名称" prop="name">
                <el-input v-model="form.name" :maxlength="size*2"></el-input>
                <div class="alt">菜单名称字数不多于{{size}}个汉字或{{size*2}}个字母,当前为{{$vFN.Utils.getByteLen(form.name)}}字母</div>
            </el-form-item>
            <el-form-item label="菜单内容" prop="type">
                <el-radio-group class="radioStyleGhost s3" v-model="form.type">
                    <el-radio :label="item.label" v-for="(item,index) in typeList" :key="index">{{item.text}}</el-radio>
                </el-radio-group>
            </el-form-item>
            <div v-if="!$vFN.Utils.isEmpty(form.subMenuLst)" class="dis">
                添加子菜单后，一级菜单的内容失效
            </div>
            <div v-else>
              
                <div v-if="form.type=='click'">
                    <el-form-item label="内容类型" prop="msgType" >
                        <el-radio-group class="radioStyleGhost s6" v-model="form.msgType">
                            <el-radio-button :label="item.label" v-for="(item,index) in msgTypeList" :key="index">
                                <div><i :class="item.icon" style="margin-right:4px"></i>{{item.text}}</div>
                            </el-radio-button>
                        </el-radio-group>
                    </el-form-item>
        
        
                    <el-form-item label="文本内容" v-if="form.msgType=='text'">
                        <el-input v-model="form._content.text" type="textarea" autosize maxlength="600" show-word-limit></el-input>
                    </el-form-item>
                    <el-form-item label="图片内容" v-if="form.msgType=='image'">
                        <el-button @click="selectImage" style="margin-bottom:10px;">选择图片</el-button><br />
                        <img v-if="form._content.image" style="width:100px; height:100px;" :src="form._content.image.albumUrl"></img>
                    </el-form-item>
                    <el-form-item label="音频内容" v-if="form.msgType=='voice'">
                        <el-button @click="selectVoice" style="margin-bottom:10px;">选择音频</el-button><br />
                        <audio v-if="form._content.voice" style="width:300px; height:50px;" controls="controls"
                            :src="form._content.voice.albumUrl"></audio>
                    </el-form-item>
                    <el-form-item label="视频内容" v-if="form.msgType=='video'">
                        <el-button @click="selectVideo" style="margin-bottom:10px;">选择视频</el-button><br />
                        <video v-if="form._content.video" style="width:300px; height:300px;" :src="form._content.video.albumUrl"
                            controls="controls"></video>
                    </el-form-item>
                    <el-form-item label="图文内容" v-if="form.msgType=='news'">
                        <el-button @click="selectTuwen" style="margin-bottom:10px;">选择图文</el-button><br />
                        <img v-if="form._content.news" style="width:100px; height:100px;" :src="form._content.news.coverUrl"></img>
                    </el-form-item>
                    <el-form-item label="关键词" v-if="form.msgType=='keyword'">
                        <el-button @click="SelectWxReplyKeyword" style="margin-bottom:10px;">选择关键词</el-button><br />
                        <div v-if="form._content.keyword">已选规则名称：{{form._content.keyword.name}}，关键词：{{form._content.keyword.keyword}}</div>
                    </el-form-item>
                </div>

                <div v-if="form.type=='miniprogram'">
                    <el-form-item label="小程序APPID" prop="appid">
                        <el-input v-model="form.appid" maxlength="20"></el-input>
                    </el-form-item>
                    <el-form-item label="小程序页面路径" prop="pagepath">
                        <el-input v-model="form.pagepath" maxlength="30"></el-input>
                    </el-form-item>
                    <el-form-item label="备用网页url" prop="url">
                        <el-input v-model="form.url" ></el-input>
                    </el-form-item>
                </div>

                <div v-if="form.type=='view'">
                  
                    <el-form-item label="跳转链接" prop="url">
                        <el-input v-model="form.url" ></el-input>
                    </el-form-item>
                </div>
    
            </div>
        </div>


    </el-form>
</div>